package com.yp.lession67.springmpemp.web.controller;


import com.yp.lession67.springmpemp.entity.Emp;
import com.yp.lession67.springmpemp.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author yp
 * @since 2022-03-24
 */

@RestController   //默认此类所有的handler 都是带上  @ResponseBody
@RequestMapping("/emp")
@CrossOrigin
public class EmpController {

    @Autowired
    private EmpService es;

    @GetMapping("/getAll")
    public List<Emp> getALL(){
        return es.list();
    }

}
